const views = require('koa-views')
const path = require('path')

export function connectHistory(app) {
  app.use(views(path.resolve(__dirname, '../../webapps'), {
    map: {
      html: 'pug'
    }
  }))

  app.use(async (ctx) => {
    await ctx.render('index.html')
  })
}